import VueRouter from 'vue-router'
import Vue from 'vue'

import Layout from '../views/layout/layout.vue'
import Home from '../views/home/home.vue'

Vue.use(VueRouter)

const routes = [
  {path: '/', redirect: '/main'},  
  { path: '/home', component:  Home },
  {path: '/main', component: Layout, children: [
    { path: 'helloworld', component: () => import('../components/HelloWorld.vue') },
    { path: 'home', component: () => import('../views/home/home.vue') },
    { path: 'totop', component: () => import('../views/backtotop/backtotop.vue') },
    { path: 'tabs', name: 'tabs', component: () => import('../views/tabs.vue') },
  ]},
  {path: '/login', component: () => import('../views/login/login.vue') },
]

const router = new VueRouter({
  routes,
  mode: 'hash'//'history'
})

export default router